//波次单
$(function(){
	$('#movestoragelistDatagrid').datagrid({
		//url:getMoveStoragelistUrl+"?randnum="+Math.floor(Math.random()*1000000),
		url:getMoveStoragelistUrl,
		title:'移库记录列表',
		fitColumns:true,
		rownumbers:true,
		pageSize:25,
		pageNumber:1,
		pageList:[1,2,5,10,15,20,25,30,40,50],
		columns:[[
		{field:'id',title:'操作'},
		{field:'goods_no',title:'商品编号',sortable:true},
		{field:'goods_name',title:'商品名称',sortable:true},
		{field:'source_no',title:'料号',sortable:true},
		{field:'manual_id',title:'账册编号',sortable:true},
		{field:'bar_code',title:'条形码',sortable:true},
		{field:'unit1',title:'第一单位',sortable:true},
		{field:'unit2',title:'第二单位',sortable:true},
		{field:'history_storage_code',title:'原库位',sortable:true,
				formatter:function(value,row,index){
					htmlobj=$.ajax({type:'post',url:getStorageUrl,data:{code:value},async:false});//ajax动态获取erp的名称
					var info=eval('('+htmlobj.responseText+')');
					return info.name;
				}
		},
		{field:'new_storage_code',title:'新库位',sortable:true,
				formatter:function(value,row,index){
					htmlobj=$.ajax({type:'post',url:getStorageUrl,data:{code:value},async:false});//ajax动态获取erp的名称
					var info=eval('('+htmlobj.responseText+')');
					return info.name;
				}
		},
		{field:'add_time',title:'移库时间',sortable:true}
		]],
		onLoadError:function(data){
			var info=eval('('+data.responseText+')');
			$.messager.confirm('错误提示',info.message,function(r){
				var tab=$('#Tabs').tabs('getSelected');
				var index=$('#Tabs').tabs('getTabIndex',tab);
				$('#Tabs').tabs('close',index);
			});
		},
		rowStyler:function(index,row){
			if (row.color==0){
				return 'background-color:pink;color:blue;font-weight:bold;';
			}
		},
		pagination:true,
		fit:true,
	});
});
movestoragelistObj={
	showAll:function(){
		$('#movestoragelistDatagrid').datagrid({ queryParams:''});
	}
}